import java.util.Scanner;

public class Main1625 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = a / 10;
        int c = a % 10;
        int d =c*10+b;
        if (a>d){
            System.out.println(a);
        }else {
            System.out.println(d );
        }
    }
}
